/* eslint no-undef: "error" */
import axios from 'axios'
import store from '../../store/index'
axios.defaults.timeout = 15000
axios.defaults.withCredentials = true
axios.interceptors.request.use((config) => {
  if (store.state.logoData.userId) {
    config.headers.userId = store.state.logoData.userId
  }
  return config
}, (error) => {
  return Promise.reject(error)
})
axios.interceptors.response.use((res) => {
  return res
}, (error) => {
  if (error) {}
  return Promise.reject(error)
})
export default axios
